#include "attack.h"

Attack::Attack()
{

	initialise();
}

Attack::Attack(Event* _event)
{

	eventData_intern = _event;

	initialise();
}


void Attack::initialise()
{

	//TTL data
	worldCreationTime = WorldData::getWorldTimeElapsed();
	timeToLiveInactive = 10.0f;
	timeToLive = 2.0f;

	//Priority value - tweak later
	priorityValue_intern = 4;

	//Stack attached to	
	stack = Stacks::immediate;
}

ActionList* Attack::generateActions()
{
	Vector3D* incomingDir = ((enemyEntersRadius_e*)eventData_intern)->enemyIncomingVector;

	incomingDir->invertDirection();

	actions_intern.add(new GotoLocation(incomingDir->x, incomingDir->y, incomingDir->z));
	actions_intern.add(new AttackAnimation());

	if (actions_intern.getSize() == 0)
		return NULL;

	return new ActionList(actions_intern);
}


bool Attack::update(float _deltaSeconds)
{
	bool stateChanged = false;

	return stateChanged;
}